#ifndef _Disk_H_
#define _Disk_H_

#pragma once
#include "Primitive.h"

class Disk : public Primitive {
private:
	Vector3 position, normal;
	Double radius, radiusSqr;
	bool doubleSide;

public:
	Disk(Vector3 &position, Normal3 &normal, Double radius, bool doubleSide = true) : 
		position(position), normal(normal), radius(radius), radiusSqr(radius * radius), doubleSide(doubleSide) {}
	~Disk() {}

	bool intersect(const Ray &ray, IntersectResult &result) const;
	bool intersectP(const Ray &ray) const;

	inline static string getName() {
		return string("Disk");
	}
	string str() const;
};

#endif // _Disk_H_

